From 31a34181c72408640b1ea728f24c6f95b4cfd36f Mon Sep 17 00:00:00 2001 From: "awilliam@xenbuild.aw" Date: Thu, 24 Aug 2006 11:52:23 -0600 Subject: [PATCH] [IA64] All vcpus can sync interrupts from qemu Previously only vcpu0 can sync interrupt from qemu. Now all vcpus can sync. Signed-off-by: Anthony Xu --- xen/arch/ia64/vmx/vmx_init.c | 3 +++ xen/arch/ia64/vmx/vmx_support.c | 4 +++- xen/include/asm-ia64/domain.h | 2 ++ xen/include/asm-ia64/vmx_vpd.h | 6 ++++++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/xen/arch/ia64/vmx/vmx_init.c b/xen/arch/ia64/vmx/vmx_init.c index bf85b7df0c..df1bc94de0 100644 --- a/xen/arch/ia64/vmx/vmx_init.c +++ b/xen/arch/ia64/vmx/vmx_init.c @@ -445,6 +445,9 @@ void vmx_setup_platform(struct domain *d) memset(&d->shared_info->evtchn_mask[0], 0xff, sizeof(d->shared_info->evtchn_mask)); + /* initiate spinlock for pass virq */ + spin_lock_init(&d->arch.arch_vmx.virq_assist_lock); + /* Initialize the virtual interrupt lines */ vmx_virq_line_init(d); diff --git a/xen/arch/ia64/vmx/vmx_support.c b/xen/arch/ia64/vmx/vmx_support.c index 3f8c4bcf0c..70b9dd7321 100644 --- a/xen/arch/ia64/vmx/vmx_support.c +++ b/xen/arch/ia64/vmx/vmx_support.c @@ -73,8 +73,10 @@ void vmx_intr_assist(struct vcpu *v) { #ifdef V_IOSAPIC_READY /* Confirm virtual interrupt line signals, and set pending bits in vpd */ - if(v->vcpu_id==0) + if (spin_trylock(&v->domain->arch.arch_vmx.virq_assist_lock)) { vmx_virq_line_assist(v); + spin_unlock(&v->domain->arch.arch_vmx.virq_assist_lock); + } #endif return; } diff --git a/xen/include/asm-ia64/domain.h b/xen/include/asm-ia64/domain.h index 394b3bc6ad..0222115242 100644 --- a/xen/include/asm-ia64/domain.h +++ b/xen/include/asm-ia64/domain.h @@ -137,6 +137,8 @@ struct arch_domain { atomic64_t shadow_fault_count; struct last_vcpu last_vcpu[NR_CPUS]; + + struct arch_vmx_domain arch_vmx; /* Virtual Machine Extensions */ }; #define INT_ENABLE_OFFSET(v) \ (sizeof(vcpu_info_t) * (v)->vcpu_id + \ diff --git a/xen/include/asm-ia64/vmx_vpd.h b/xen/include/asm-ia64/vmx_vpd.h index 82363a2876..b534268ebb 100644 --- a/xen/include/asm-ia64/vmx_vpd.h +++ b/xen/include/asm-ia64/vmx_vpd.h @@ -27,6 +27,7 @@ #include #include #include +#include #define VPD_SHIFT 17 /* 128K requirement */ #define VPD_SIZE (1 << VPD_SHIFT) @@ -72,6 +73,11 @@ struct ivt_debug{ }; #define IVT_DEBUG_MAX 128 #endif + +struct arch_vmx_domain { + spinlock_t virq_assist_lock; /* spinlock for pass virq */ +}; + struct arch_vmx_struct { // vpd_t *vpd; vtime_t vtm; -- 2.30.2